define(function (require) {
    var Base = require('group/common/main');
    var utils = require('common/utils/home');
    var Mask = require('common/mask');
    var mask = new Mask();

    return Base.extend({
        initialize: function (params) {
            var _this = this;
            Base.prototype.initialize.apply(this, [params]);
            if (_this['page_' + _global.a]) {
                _this['page_' + _global.a]();
            }
        },
        page_index: function () {
            var _this = this;
            _this.waterfall();
            _this.$('#J_member_favs').click(function () {
                var $this = $(this);
                utils.ajaxPost({a: 'favs', mid: $this.data('mid')}, function (resp) {
                    if ($this.hasClass('ac')) {
                        $this.removeClass('ac');
                    }
                    else {
                        $this.addClass('ac');
                    }
                    _this.$('#J_show_favs_num').html(resp.data.favs);
                    mask.success('操作成功');
                });
            });
        }
    });
});